//
//  SampuxGetLogOutValue.m
//  Sampux
//
//  Created by rzm on 16/9/2.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "SampuxGetLogOutValue.h"
#import "SPLogOutModel.h"

@implementation SampuxGetLogOutValue
+ (NSMutableArray *)getLogOutData:(NSMutableArray*)tempArr
{
    NSMutableArray *array = [NSMutableArray array];
    for (int i = 0; i < tempArr.count; i ++) {
        GBInterMaster_Bean_DeviceInfo13001* info = tempArr[i];
        SPLogOutModel *logOutmodel = [[SPLogOutModel alloc]init];
        if (info.workMode == 3) {
            logOutmodel.workStr = @"自动";
        }else
        {
            logOutmodel.workStr = @"手动";
        }
        if (info.heatMode == 1) {
            logOutmodel.heatStr = @"速热";
        }else if (info.heatMode == 2)
        {
            logOutmodel.heatStr = @"舒适";
        }else
        {
            logOutmodel.heatStr = @"节能";
        }
        logOutmodel.runTimeStr = info.stateTime;
        logOutmodel.setTempStr = [NSString stringWithFormat:@"%d%@",info.currentSetTempe,THUnitType_C];
        logOutmodel.indoorTempStr = STRING_LONG(info.currentRoomTempe);
        logOutmodel.indoorhumidityStr = STRING_INT(info.currentRoomHumidity);
        
        if ([logOutmodel.indoorTempStr isEqualToString:@"10000"]) {
            logOutmodel.indoorTempStr = @"E2";
        }else
        {
            logOutmodel.indoorTempStr = [NSString stringWithFormat:@"%d%@",info.currentRoomTempe,THUnitType_C];
        }
        if ([logOutmodel.indoorhumidityStr isEqualToString:@"10000"]) {
            logOutmodel.indoorhumidityStr = @"E1";
        }else
        {
            logOutmodel.indoorhumidityStr = [NSString stringWithFormat:@"%d%@",info.currentRoomHumidity,THUnitType_percent];
        }
        [array addObject:logOutmodel];
    }
    return array;
}
@end
